package com.erau.droidsatframework;

import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;
import android.widget.Toast;
import android.graphics.*;

import com.erau.droidsatframework.core.*;

public class DroidSatActivity extends Activity {
    
	private TextView tv;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        tv = new TextView(this);
        
        tv.setBackgroundColor(Color.GREEN);
        tv.setTextColor(Color.BLACK);
        
        setContentView(tv);
        
        tv.setText("Program Initializing...\n");
        
    }
    
    @Override
    public void onStart() {
    	super.onStart();
    	
    	
    	//Start The Core
    	tv.append("Initiating the core...\n");
    	Intent coreIntent = new Intent(this, CoreService.class);
    	ComponentName cName;
    	cName = startService(coreIntent);
    	
    	//Verify Start of core...
    	if(cName != null){
    		tv.append("Core is now online...\n");
    	}
    	else{
    		tv.append("Failed to start the service...\n");
    	}
    }
    
    
}